package com.hylink.controller;

import com.hylink.base.BaseAction;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map;

@Controller
@RequestMapping("/testhello")
public class HelloController extends BaseAction{

    @RequestMapping("/hello")
    public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
        model.addAttribute("name", name);


      return "hello/hello";
     //  return "bootstrapdemo/hello";
    }


    @RequestMapping(value = "/hellojsp", method = RequestMethod.GET)
    public String greeting1(HttpServletRequest request,
                            HttpServletResponse response, Map<Object, Object> map) {
        HttpSession session = request.getSession();
        //return "hello/hello";
        return "bootstrapdemo/demo/index";
    }
    
}
